<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>layui</title>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport"
	content="width=device-width, initial-scale=1, maximum-scale=1">
<script src="../../../js/angular.js"></script>
<script src="../../../js/angular.js" charset="utf-8"></script>
<link rel="stylesheet" href="../../../layui/css/layui.css" />

<script src="https://code.jquery.com/jquery-3.2.1.min.js"></script>
<script type="text/javascript" src="fy.js"></script>


<style>
#left {
	float: left;
	width: 30%;
}
#down {
	width: 95%;
	
}

#right {
	float: left;
	width:65%;
}
</style>
</head>
<body>
<br>

	<!-- 邮件发送 -->

	<div ng-app="myApp" ng-controller="customersCtrl" align="center">
	
	<div id="left">
<br>
		<form class="layui-form" action="">
			<div class="layui-form-item">
				<div class="layui-inline">
					<label class="layui-form-label">缴存账号：</label>
					<div class="layui-input-inline">
						<input name="phone" lay-verify="required|phone" autocomplete="off"
							class="layui-input" type="tel" id="GJJJCZH" name="GJJJCZH">
					</div>
				</div>
				<div class="layui-inline">
					<label class="layui-form-label">单位代码：</label>
					<div class="layui-input-inline">
						<input name="email" lay-verify="email" autocomplete="off"
							class="layui-input" type="text" id="DWDM" name="DWDM">
					</div>
				</div>
				<div class="layui-inline">
					<label class="layui-form-label">单位名称：</label>
					<div class="layui-input-inline">
						<input name="phone" lay-verify="required|phone" autocomplete="off"
							class="layui-input" type="tel"  id="DWMC" name="DWMC">
					</div>
				</div>
			</div>
			
			<div class="layui-form-item">
				<div class="layui-inline">
					<label class="layui-form-label">缴存银行：</label>
					<div class="layui-input-inline">
						<input name="phone" lay-verify="required|phone" autocomplete="off"
							class="layui-input" type="tel" id="JCYH" name="JCYH">
					</div>
				</div>
				<div class="layui-inline">
					<label class="layui-form-label">银行代码：</label>
					<div class="layui-input-inline">
						<input name="email" lay-verify="email" autocomplete="off"
							class="layui-input" type="text" id="YHDM" name="YHDM">
					</div>
				</div>
				<div class="layui-inline">
					<label class="layui-form-label">应缴金额：</label>
					<div class="layui-input-inline">
						<input name="phone" lay-verify="required|phone" autocomplete="off"
							class="layui-input" type="tel" >
					</div>
				</div>
			</div>
			
			<button class="layui-btn layui-btn-primary" id="sc">生成汇缴订单</button>
		</form>
		</div>
		<div id="right">
		<Loading></Loading>
			<table class="layui-table" style="width:90%">
					<tr align="center" style="background-color:#f1f1f1">
						<td ng-show=false>当前行数</td>
						<td>应缴年月</td>
						<td>应缴金额</td>
						<td>操作</td>

					</tr>
					<tr ng-repeat="x in names1" align="center">
						<td ng-if="$odd" ng-show=false style="background-color:#f1f1f1">{{
							$index+1 }}</td>
						<td ng-if="$even" ng-show=false>{{ $index+1 }}</td>
						<td ng-if="$odd" style="background-color:#f1f1f1">{{
							x.JCNY }}</td>
						<td ng-if="$even">{{ x.JCNY }}</td>
						<td ng-if="$odd" style="background-color:#f1f1f1">{{ x.DWJCE
							}}</td>
						<td ng-if="$even">{{ x.DWJCE }}</td>
						<td ng-if="$odd" style="background-color:#f1f1f1"><input
							type="button" ng-click="ck($index)" style="color: red"
							value="查看明细">
							<input
							type="button" ng-click="de($index)" style="color: red"
							value="&nbsp;删&nbsp;&nbsp;除&nbsp;">
						</td>
						<td ng-if="$even"><input
							type="button" ng-click="ck($index)" style="color: red"
							value="查看明细">
							<input
							type="button" ng-click="de($index)" style="color: red"
							value="&nbsp;删&nbsp;&nbsp;除&nbsp;">
						</td>
					</tr>
				</table>
		
		
		
		
				
		</div>
	
	<div id="down">
	
	<table class="layui-table" style="width:90%">
					<tr align="center" style="background-color:#f1f1f1">
						<td ng-show=false>当前行数</td>
						<td>年月</td>
						<td>个人账号</td>
						<td>证件号码</td>
						<td>单位月缴存额</td>
						<td>个人月缴存额</td>
						<td>月缴存额</td>
						<td>地区代码</td>
						<td>单位账号</td>
						<td>审核</td>
						<td>审核日期</td>
						<td>性别</td>
						<td>姓名</td>

					</tr>
					<tr ng-repeat="y in names" align="center">
						<td ng-if="$odd" ng-show=false style="background-color:#f1f1f1">{{
							$indey+1 }}</td>
						<td ng-if="$even" ng-show=false>{{ $indey+1 }}</td>
						<td ng-if="$odd" style="background-color:#f1f1f1">{{
							y.NIANYUE }}</td>
						<td ng-if="$even">{{ y.NIANYUE }}</td>
						<td ng-if="$odd" style="background-color:#f1f1f1">{{ y.GRZH
							}}</td>
						<td ng-if="$even">{{ y.GRZH }}</td>
						<td ng-if="$odd" style="background-color:#f1f1f1">{{ y.ZJHM
							}}</td>
						<td ng-if="$even">{{ y.ZJHM }}</td>
						<td ng-if="$odd" style="background-color:#f1f1f1">{{ y.DWJCE
							}}</td>
						<td ng-if="$even">{{ y.DWJCE }}</td>
						<td ng-if="$odd" style="background-color:#f1f1f1">{{ y.GRJCE
							}}</td>
						<td ng-if="$even">{{ y.GRJCE }}</td>
						<td ng-if="$odd" style="background-color:#f1f1f1">{{ y.YJJE
							}}</td>
						<td ng-if="$even">{{ y.YJJE }}</td>
						<td ng-if="$odd" style="background-color:#f1f1f1">{{ y.DQDM
							}}</td>
						<td ng-if="$even">{{ y.DQDM }}</td>
						<td ng-if="$odd" style="background-color:#f1f1f1">{{ y.DWZH
							}}</td>
						<td ng-if="$even">{{ y.DWZH }}</td>
						<td ng-if="$odd" style="background-color:#f1f1f1">{{ y.SH
							}}</td>
						<td ng-if="$even">{{ y.SH }}</td>
						<td ng-if="$odd" style="background-color:#f1f1f1">{{ y.SHRQ
							}}</td>
						<td ng-if="$even">{{ y.SHRQ }}</td>
						<td ng-if="$odd" style="background-color:#f1f1f1">{{ y.XB
							}}</td>
						<td ng-if="$even">{{ y.XB }}</td>
						<td ng-if="$odd" style="background-color:#f1f1f1">{{ y.XM
							}}</td>
						<td ng-if="$even">{{ y.XM }}</td>
						
					</tr>
				</table>
					<div class="layui-btn-group">
				<button class="layui-btn layui-btn-primary layui-btn-sm"
					ng-click="Sy()">首页</button>
				<button class="layui-btn layui-btn-primary layui-btn-sm"
					ng-click="Previous()">上一页</button>
				<button ng-repeat="page in pageList"
					class="layui-btn layui-btn-primary layui-btn-sm "
					ng-click="selectPage(page)">{{page}}</button>
				<button class="layui-btn layui-btn-primary layui-btn-sm"
					ng-click="Next()">下一页</button>
				<button class="layui-btn layui-btn-primary layui-btn-sm"
					ng-click="Wy()">尾页</button>
				<button class="layui-btn layui-btn-primary layui-btn-sm ">{{selPage}}/{{pages}}</button>
			</div>
	</div>
		</div>




	<!-- 		<table class="layui-hide" id="LAY_table_user" lay-filter="user"></table>   -->
	<script src="../../../layui/layui.js" charset="utf-8"></script>
	<script type="text/javascript">
	
	
	var app = angular.module('myApp', []);
	 app.directive('loading', function(){  
		        return {  
		            restrict: 'E',  
		            transclude: true,  
		            template: '<div ng-show="loading" class="loading" id="allDiv"  style="position:fixed; top:0px; left:0px; width:100%; height:100%; display:none; background-color:#000; opacity: 0.5; z-index:99999;">'  
		            +'<img alt="" src="../../../layui/img/jz.gif" style="vertical-align: middle;width:30px; height:30px; position: absolute; top:50%; left:50%; margin-top: -50px; margin-left:-50px;"/>'
		            +'</div>',  
		            link: function (scope, element, attr) {  
		                scope.$watch('loading', function (val) {  
		                    if (val){  
		                        document.getElementById("allDiv").style.display = "block";  
		                    }else{  
		                        document.getElementById("allDiv").style.display = 'none';  
		  
		                    }  
		                });  
		            }  
		        };
		    }); 
	   app.controller('customersCtrl', function($scope, $http) {
	     $scope.setLoading =function(){  
			    if($scope.loading ==undefined || $scope.loading ==false){  
			        $scope.loading=true;  
			    }else{  
			        $scope.loading=false;  
			    };
			};
			 $scope.setLoading ();
	   $http({
							url:getPath()+"/wsyyt/hjgncontroller/test1",
							contentType:"text/html;charset=utf-8",
							method:'post'			
						})
					.then(function(res) {
						$scope.setLoading();
									layer.msg('提示：'+res.data.msg);	
									$scope.names1=res.data.data;
									if($scope.names1.length>0&&$scope.names1!=null){
										//$("#sc").hide();
									}
					});
					
			
					 $scope.setLoading ();
	   		$http({
							url:getPath()+"/wsyyt/hjgncontroller/test",
							contentType:"text/html;charset=utf-8",
							method:'post'				
						})
					.then(function(res) {
						$scope.setLoading();
									layer.msg('提示：'+res.data.msg);	
					});
					
					$scope.ck=function(index){
						$scope.setLoading();
						$http({
							url:getPath()+"/wsyyt/hjgncontroller/test2",
							params:{ID:$scope.names1[index].DWJJID,NY:$scope.names1[index].JCNY},
							contentType:"text/html;charset=utf-8",
							method:'post'				
						})
					.then(function(res) {
						$scope.names=res.data.data;
						$scope.setLoading();
						feny($scope.names);
									layer.msg('提示：'+res.data.msg);	
					});
					
					};
					
						$scope.de=function(index){
						$scope.setLoading();
						$http({
							url:getPath()+"/wsyyt/hjgncontroller/test3",
							params:{ID:$scope.names1[index].DWJJID,NY:$scope.names1[index].JCNY},
							contentType:"text/html;charset=utf-8",
							method:'post'				
						})
					.then(function(res) {
						$scope.names=res.data.data;
						$scope.setLoading();
						 location.reload();
									layer.msg('提示：'+res.data.msg);	
					});
					
					}
	   
	   });
	</script>
	<script type="text/javascript" id="barDemo">
		function getPath() {
		    return 'http://'+location.host;
		};
	</script>
	
	<script>
layui.use('table', function(){
  var table = layui.table;
  
  table.render({
    elem: '#LAY_table_user'
    ,url: getPath()+'/wsyyt/dwjbxxcontroller/test'
    ,cols: [[
      {type:'checkbox', title: '操作'}
      ,{field:'username', width:90, title: '应缴年月'}
      ,{field:'sex', width:90, title: '应缴金额'}
      
    ]]
    ,page: true
  });
});
</script>
<script type="text/javascript">
	$.ajax({
				url : getPath()+'/wsyyt/hjgncontroller/test',
				method : 'post',
				dataType : 'JSON',
				success : function(result) {
						var data = result.data;
						for(var t=0;t<data.length;t++)
						{
							if(data[t].DWDM!=""&&data[t].DWDM!=null)
							{
								$.each(data[t], function(key, value) {
								$("#" + key).val(value || "");
							});
						
							}
						}
				},

			});
		     function getPath() {  
	     
	        return 'http://'+location.host;
	}
$("#sc").click(function(){
			parent.location.href=getPath()+'/wsyyt/dwwsyyt/dw/gjjhbj/jctsqr.html';
		});
			
	</script>

</body>
</html>